// import { RouteRecordRaw } from 'vue-router';

export const Layout = () => import('@/layout/index.vue');

const routes = [
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/login/index.vue'),
  },
  {
    component: Layout,
    path: '/',
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          title: '首页',
          icon: 'House',
        },
        /** 在src/views 文件下创建home文件 */
        component: () => import('@/views/home/home.vue'),
      },
      {
        path: '/system',
        name: 'system',
        meta: {
          title: '系统概况',
          icon: 'Grid',
        },
        /** 在src/views 文件下创建system文件 */
        component: () => import('@/views/system/index.vue'),
      },
      {
        path: '/userManagement',
        name: 'userManagement',
        meta: {
          title: '用户管理',
          icon: 'Avatar',
        },
        /** 在src/views 文件下创建userManagement文件 */
        // component: () => import("@/views/userManagement/index.vue"),
        children: [
          {
            path: '/product',
            name: 'product',
            meta: {
              title: '产品1',
              icon: 'TakeawayBox',
            },
            component: () => import('@/views/userManagement/productAdministrator/index.vue'),
          },
          {
            path: '/prod',
            name: 'istrator',
            meta: {
              title: '产品2',
              icon: 'TakeawayBox',
            },
            component: () => import('@/views/userManagement/productAdministrator1/index.vue'),
          },
          {
            path: '/from',
            name: 'fromtest',
            meta: {
              title: '产品3',
              icon: 'TakeawayBox',
            },
            component: () => import('@/views/userManagement/fromTest/index.vue'),
          },
        ],
      },
      {
        path: '/setting',
        name: 'setting',
        meta: {
          title: '系统设置',
          icon: 'Setting',
        },
        /** 在src/views 文件下创建information文件 */
        children: [
          {
            path: '/setting/one',
            name: 'productAdministrator',
            meta: {
              title: '系统设置1',
              icon: 'TakeawayBox',
            },
            children: [
              {
                path: '/setting/one/two',
                name: 'productAdministrator',
                meta: {
                  title: '系统设置2',
                  icon: 'TakeawayBox',
                },
                component: () => import('@/views/sys/index.vue'),
              },
            ],
          },
        ],
      },
      {
        path: '/404',
        name: 'notFound',
        meta: {
          hidden: true,
        },
        component: () => import('@/views/404/notfound.vue'),
      },
    ],
  },
];

export default routes;
